taskLog=/data/sync2prod/$deployment

echo "仅同步到 %taskLog "

rm -rf $taskLog
mkdir -p $taskLog
cd $taskLog

touch sync-task.log

host=https://test.huatuocloud.com/api/mp-admin-api
#host=http://192.168.2.117:8001

imageNameVersion="$language/$deployment:$imageVersion"


function dockerPush() {
   echo $imageNameVersion
   echo -e `date "+%Y-%m-%d %H:%M:%S"` 开始拉取
	echo -e "docker pull harbor.huatuocloud.com:7443/$imageNameVersion"
	docker pull harbor.huatuocloud.com:7443/$imageNameVersion
	docker tag  harbor.huatuocloud.com:7443/$imageNameVersion  reg2.huatuocloud.com/$imageNameVersion


	if ps aux | grep -v grep | grep -q "docker push reg2.huatuocloud.com/$imageNameVersion"; then
	    return;
	fi

	echo -e `date "+%Y-%m-%d %H:%M:%S"` 开始推送
	echo -e "docker push reg2.huatuocloud.com/$imageNameVersion"
	docker push reg2.huatuocloud.com/$imageNameVersion

     echo -e "\n[sync done]"
}



dockerPush  | tee  sync-task.log

